function x = Vec2struct(X, indices, size_image)
% x = Vec2struct(X, indices, size_image)
% 
% Vec2struct converts an image which is given as a vector into a struct
% using the indices and size_image as extra information. 
%
% See also: Struct2vec, Im2struct, Struct2im 
%
% 2013-07-25 --------------------------------------------------------------
% 
% Matthias J. Ehrhardt
% CMIC, University College London, UK
% 
% matthias.ehrhardt.11@ucl.ac.uk
% 
% -------------------------------------------------------------------------

    K = length(indices);    
    x = cell(K,1);
    
    for k = 1 : K
        x{k} = reshape(X(indices{k}), size_image);
    end
end

